<?php
class AlumnosController extends AppController
{
var $name = 'Alumnos';
var $helpers = array('Html', 'Form' );
function index() {
    $this->layout = 'publicidad_pequena_pordefecto';
    $this->set('alumnos', $this->Alumno->find('all'));
}

function edit($Rut = null) {
        $this->Alumno->Rut = $Rut;
        $this->data = $this->Alumno->read();
        $this->set('alumnos', $this->Alumno->find('all', array('conditions'=>array('Alumno.Rut'=>$this->data))));
        if (empty($this->data)) {
                
                $this->Alumno->Rut = $Rut;
                $this->data = $this->Alumno->read();
                #$this->set('alumnos', $this->Alumno->find('all'));
        } #else {
           #     if ($this->Alumno->save($this->data['Alumno'])) {
            #            $this->flash('Los datos del alumno han sido actualizados','/Alumnos/index');
             #   }
        #}
} 
function add() {
	        if (!empty($this->data)) {
	            if ($this->Alumno->save($this->data)) {
	                $this->flash('Enlace añadido.','/alumnos/index');
	            }
	        }
	    } 


} //fin de la clase
?> 